import Vue from "vue";
import Vuex from "vuex";
import user from "./user";
import address from "./address";

import persistence from "vuex-uniapp-persistence";

Vue.use(Vuex);

const store = new Vuex.Store({
  state: {
    safeArea: uni.getWindowInfo().safeArea,
    capButton: uni.getMenuButtonBoundingClientRect(),
    // 1. 获取平台名称
    platform: uni.getSystemInfoSync().platform,
  },
  getters: {},
  mutations: {},
  modules: {
    user,
    address,
  },
  actions: {},
  plugins: [persistence("mini-rabbit")],
});
export default store;
